<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header','admin');
?>
<style>
body {
	margin:0 10px 0 0;
	font-size:14px;
}
span {
	font-size:14px;
}
.cont {
	margin:0 0 0 200px;
}
.det {
	margin:0 50px 0 0;
	color:red;
}
tr{
	height:20px;
}
.shuju{
	color:red;
}


</style>
<div class="cont">
<h3 style="margin:0 0 0 200px;"><?php echo $data_1['orderid']?>号订单详情</h3>
<table style="margin:0px 0 0 0px; width:600px; font-size:14px;">
<tr><th style="width:50%"></th><th style="width:50%"></th><th></th></tr>
<tr><td>收货仓库：<span class="shuju"><?php echo $data_2['warehouse'];?></span></td><td>转运公司：<span class="shuju"><?php echo $data_2['zhcompany'];?></span></td></tr>
<tr><td>转运单号：<span class="shuju"><?php echo $data_1['zhnumber'];?></span></td><td>包裹内容：<span class="shuju"><?php echo $data_2['pack'];?></span></td></tr>
<tr><td>商品类数：<span class="shuju"><?php echo $leishu;?></span></td><td>备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注：<span class="shuju"><?php echo $data_1['remark'];?></span></td></tr>
<tr><td>渠&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;道：<span class="shuju"><?php echo $data_1['channel'];?></span></td><td>重&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;量：<span class="shuju"><?php echo $data_1['weight'];?></span></td></tr>
<tr><td>下单时间：<span class="shuju"><?php echo date('Y-m-d',$data_1['uptime']);?></span></td>
<td>是否支付：<span class="shuju"><?php echo $data_1['ispay'];?></span></td></tr>
</table>
<table style="margin:0px 0 0 0px; width:600px;">
<tr><td>收&nbsp;&nbsp;货&nbsp;人：<span class="shuju"><?php echo $address['consignee'];?></span></td><td>收货公司：<span class="shuju"><?php echo $address['company'];?></span></td></tr>
<tr><td>手&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;机：<span class="shuju"><?php echo $address['mobile'];?></span></td><td>电&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;话：<span class="shuju"></span></td></tr>
<tr><td>邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;编：<span class="shuju"><?php echo $address['postcode'];?></span></td><td>证件号码:<span class="shuju"><?php echo $address['identitycard'];?></span></td></tr>
<tr><td>英文地址：<span class="shuju"><?php echo $address['e_address'];?></span></td><td><span class="shuju"></span></td></tr>
<tr><td>中文地址：<span class="shuju"><?php echo $address['c_address'];?></span></td><td><span class="shuju"></span></td></tr>
</table>
<table style="margin:0px 0 10px 0px; width:600px;">
<?php $n=1;if(is_array($data_3)) foreach($data_3 AS $r) { ?>
<tr><td>商&nbsp;品&nbsp;&nbsp;名：<span class="shuju"><?php echo $r['name'];?></span></td><td>数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;量：<span class="shuju"><?php echo $r['amount'];?></span></td><td>单&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;价$：<span class="shuju"><?php echo $r['price'];?></span></td></tr>
<?php $n++;}unset($n); ?>
</table>
<h2>仓储保价费￥：<span class="shuju"><?php echo $data_2['whprice'];?></span></h2>
<h2>运&nbsp;&nbsp;送&nbsp;费￥：<span class="shuju"><?php echo $data_1['orderprice'];?></span></h2>
<h2>应付关税￥：<span class="shuju"><?php echo $data_1['tariff'];?></span></h2>
<h2>总&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;计￥：<span class="shuju"><?php echo $zongjia;?></span></h2>
<h2>是否支付：<span class="shuju" id="ispay"><?php echo $data_1['ispay'];?></span></h2>
<div style="margin:10px 0 0 300px;">
<p>
<form action='' method="post" id="form1">
<input type=text hidden="hidden" name="orderid" value="<?php echo $data_1['id']?>">
<span>选择该订单状态类型：</span>
<select name="state" id="state">
<option value="2">审核完成待入库</option>
<option value="3">已入库</option>
<option value="4">转运途中</option>
<option value="5">已出库</option>
<option value="6">运送完成</option>
<option value="7">取消该订单</option>
</select>
</p>
<p>订单当前状态：<span style="color: red">
<?php 
switch ($data_1['state']){
case 1:
	echo '订单审核中';
	break;
case 2:
	echo '审核完成待入库';
	break;
case 3:
	echo '已入库';
	break;
case 4:
	echo '转运中';
	break;
case 5:
	echo '已出库';
	break;
case 6:
	echo '运送完成';
	break;
case 7:
	echo '订单已取消';
	break;
default:
	echo '未知状态';
}
?>

</span></p>
<input type="button" onclick="con()" value="确认更改" style="margin:10px 0 0 200px;">
</form>
</div>
</body>
<script type="text/javascript">
function con(){
	
	var state=document.getElementById("state");
	//alert(state[2].selected);
	for(var i=0;i<state.length;i++){
		if(state[i].selected==true){
			var innerT=state[i].innerHTML;
			}
		}
	var res=confirm('确定改变该订单的状态为'+innerT);
	if(ispay.innerHTML=="否")res=confirm('客户尚未付款，请你再次确认一篇！！');
	if(res){
		form1.submit();
		}
	return false;
}
</script>
</html>